package com.dave.gd.core.util;

import java.io.Serializable;
import java.util.List;

/**
 * 
 * a <code>RetInfo</code> means a Result
 * .
 * @author hehuang
 * @date 2014/12/01
 * 
 * @see com.ctg.itrdc.core.constants.RET_TRUE
 * @see com.ctg.itrdc.core.constants.RET_FALSE
 *
 */
public class RetInfo implements Serializable {

	private static final long serialVersionUID = -4452740092879878740L;

	private String            result;                                // 返回结果
     
    private String            retCode;                               // 返回编码
                                                                      
    private String            retMsg;                                // 返回信息
                                                                      
    private List<Object>      dataList;                              // 返回数据集合
                                                                      
    private Object            object;                                // 结果对象
                  
    /**
     * 
     * newInstance
     * .	
     * @return
     * 		RetInfo
     *
     */
    public static RetInfo newInstance() {
        RetInfo RetInfo = new RetInfo();
        return RetInfo;
    }
    
    /**
     * 
     * newInstance
     * 	根据结果编码和结果提示实例化
     * .	
     * @param result
     * @param retMsg
     * @return
     *
     */
    public static RetInfo newInstance(String result, String retMsg) {
        RetInfo RetInfo = new RetInfo();
        RetInfo.setResult(result);
        RetInfo.setRetMsg(retMsg);
        return RetInfo;
    }
    
    /**
     * 
     * @return Object
     * 			结果对象
     */
    public Object getObject() {
        return this.object;
    }
    
    /**
     * @param object
     *            结果对象
     */
    public void setObject(final Object object) {
        this.object = object;
    }
    
    /**
     * 获取结果集对象
     * .
     * @return List
     * 			结果集对象
     */
    public List<Object> getDataList() {
        return this.dataList;
    }
    
    /**
     * 设置结果集对象
     * .
     * @param dataList
     *            结果集对象
     */
    public void setDataList(final List<Object> dataList) {
        this.dataList = dataList;
    }
    
    /**
     * 设置处理结果
     * .
     * @return String
     * 			处理结果
     */
    public String getResult() {
        return this.result;
    }
    
    /**
     * 获取处理结果
     * .
     * @param result
     *            处理结果
     */
    public void setResult(final String result) {
        this.result = result;
    }
    
    /**
     * 获取结果编码
     * .
     * @return String
     * 			处理结果编码
     */
    public String getRetCode() {
        return this.retCode;
    }
    
    /**
     * 设置结果编码
     * .
     * @param retCode
     *            处理结果编码
     */
    public void setRetCode(final String retCode) {
        this.retCode = retCode;
    }
    
    /**
     * 获取处理结果提示
     * .
     * @return String
     * 			处理结果提示
     */
    public String getRetMsg() {
        return this.retMsg;
    }
    
    /**
     * 设置处理结果提示
     * .
     * @param retMsg
     *            处理结果提示
     */
    public void setRetMsg(final String retMsg) {
        this.retMsg = retMsg;
    }
    
    /**
     * 对返回结果、信息、编码设值.
     * 
     * @param retMsg
     *            返回信息
     * @param retCode
     *            返回编码
     * @param result
     *            返回结果
     */
    public void setRetRsCodeMsg(final String result, final String retCode, final String retMsg) {
        this.setResult(result);
        this.setRetCode(retCode);
        this.setRetMsg(retMsg);
    }
    
    public void setRetCodeMsg(final String result, final String retMsg) {
    	this.setResult(result);
    	this.setRetMsg(retMsg);
    }
}
